Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instrgen directory for source level instrumentation #3068

Merged
merged 3 commits into from
Dec 13, 2022

Conversation

pdelewski
Copy link
Member

This PR adds new directory for source instrumentation according to discussions

open-telemetry/opentelemetry-go-instrumentation#3
#2834

Copy link
Contributor

@MrAlias MrAlias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the owners file with the @open-telemetry/go-approvers, you @pdelewski, and me the owners of this directory.

@pdelewski
Copy link
Member Author

@MrAlias Seems that my user does not have write access rights to this repo

@MrAlias
Copy link
Contributor

MrAlias commented Dec 8, 2022

@MrAlias Seems that my user does not have write access rights to this repo

@Aneurysm9 is this an issue you've seen in the collector contrib?

@MrAlias MrAlias closed this Dec 8, 2022
@MrAlias MrAlias reopened this Dec 8, 2022
@MrAlias

This comment was marked as resolved.

Copy link
Contributor

@MrAlias MrAlias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an instrgen/go.mod to identify the new directory as a go module.

CHANGELOG.md Outdated Show resolved Hide resolved
instrgen/README.md Outdated Show resolved Hide resolved
instrgen/README.md Outdated Show resolved Hide resolved
instrgen/README.md Outdated Show resolved Hide resolved
instrgen/README.md Outdated Show resolved Hide resolved
@MrAlias
Copy link
Contributor

MrAlias commented Dec 8, 2022

@MrAlias Seems that my user does not have write access rights to this repo

@Aneurysm9 is this an issue you've seen in the collector contrib?

@pdelewski it sounds like these types of errors are ignored in the collector contrib. It will not be a blocker to merging as it will correctly identify the owner of the new package.

@pdelewski pdelewski force-pushed the introducing-instrgen branch 2 times, most recently from dc1b66a to b14e1c2 Compare December 8, 2022 20:40
@pdelewski
Copy link
Member Author

@MrAlias I updated Readme.md according to your suggestions. Please check it and approve if everything is ok. I plan to open a PR with instrgen implementation ASAP

@MrAlias
Copy link
Contributor

MrAlias commented Dec 9, 2022

This is still needed.

Please add an instrgen/go.mod to identify the new directory as a go module.

Be sure to run the dependabot generation script after it is added.

Copy link
Contributor

@MrAlias MrAlias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good outside of adding a go.mod file.

CHANGELOG.md Outdated Show resolved Hide resolved
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Dec 9, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: pdelewski / name: Przemyslaw Delewski (0b2d2c0)

@pdelewski pdelewski force-pushed the introducing-instrgen branch 2 times, most recently from b11fdc6 to 0b2d2c0 Compare December 9, 2022 09:30
@pdelewski
Copy link
Member Author

Looks good outside of adding a go.mod file.

This now is failing as there are no go files to analyze. Should not go.mod be added together with implementation?

@MrAlias
Copy link
Contributor

MrAlias commented Dec 9, 2022

Looks good outside of adding a go.mod file.

This now is failing as there are no go files to analyze. Should not go.mod be added together with implementation?

Adding a doc.go file will solve this. E.g.

// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*
Package instrgen provides a code generation utility that instruments existing
source code with OpenTelemetry.
*/
package instrgen // import "go.opentelemetry.io/contrib/instrgen"

@pdelewski
Copy link
Member Author

@MrAlias Seems that I cannot merge it

@MrAlias
Copy link
Contributor

MrAlias commented Dec 9, 2022

@MrAlias Seems that I cannot merge it

Right. That is something maintainers of this project will do.

First, the tests need to succeed and another approver from another company needs to approve this: https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CONTRIBUTING.md#pull-requests

@pdelewski
Copy link
Member Author

@MrAlias Seems that I cannot merge it

Right. That is something maintainers of this project will do.

First, the tests need to succeed and another approver from another company needs to approve this: https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/CONTRIBUTING.md#pull-requests

@jmacd @MadVikingGod Could you look at this PR?

@pdelewski
Copy link
Member Author

@MadVikingGod Could you merge it? as I don't have permissions yet

MadVikingGod and others added 2 commits December 13, 2022 11:58
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
@MadVikingGod
Copy link
Contributor

@pdelewski Even after this is merged you won't have merge permissions. That is only permitted to the maintainers group.

@pdelewski
Copy link
Member Author

@pdelewski Even after this is merged you won't have merge permissions. That is only permitted to the maintainers group.

@MadVikingGod Yes, I know but approver should have them, right?

@MadVikingGod MadVikingGod merged commit 3e6928d into open-telemetry:main Dec 13, 2022
MrAlias added a commit that referenced this pull request May 21, 2024
### Added

- Add the new `go.opentelemetry.io/contrib/instrgen` package to provide
auto-generated source code instrumentation. (#3068, #3108)
- Add an experimental `OTEL_METRICS_PRODUCERS` environment variable to
`go.opentelemetry.io/contrib/autoexport` to be set metrics producers.
(#5281)
- `prometheus` and `none` are supported values. You can specify multiple
producers separated by a comma.
- Add `WithFallbackMetricProducer` option that adds a fallback if the
`OTEL_METRICS_PRODUCERS` is not set or empty.
- The `go.opentelemetry.io/contrib/processors/baggage/baggagetrace`
module. This module provides a Baggage Span Processor. (#5404)
- Add gRPC trace `Filter` for stats handler to
`go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc`.
(#5196)
- Add a repository Code Ownership Policy. (#5555)
- The `go.opentelemetry.io/contrib/bridges/otellogrus` module. This
module provides an OpenTelemetry logging bridge for
`github.com/sirupsen/logrus`. (#5355)
- The `WithVersion` option function in
`go.opentelemetry.io/contrib/bridges/otelslog`. This option function is
used as a replacement of `WithInstrumentationScope` to specify the
logged package version. (#5588)
- The `WithSchemaURL` option function in
`go.opentelemetry.io/contrib/bridges/otelslog`. This option function is
used as a replacement of `WithInstrumentationScope` to specify the
semantic convention schema URL for the logged records. (#5588)
- Add support for Cloud Run jobs in
`go.opentelemetry.io/contrib/detectors/gcp`. (#5559)

### Changed

- The gRPC trace `Filter` for interceptor is renamed to
`InterceptorFilter`. (#5196)
- The gRPC trace filter functions `Any`, `All`, `None`, `Not`,
`MethodName`, `MethodPrefix`, `FullMethodName`, `ServiceName`,
`ServicePrefix` and `HealthCheck` for interceptor are moved to
`go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/filters/interceptor`.
With this change, the filters in
`go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc`
are now working for stats handler. (#5196)

- `NewLogger` now accepts a `name` `string` as the first argument. This
parameter is used as a replacement of `WithInstrumentationScope` to
specify the name of the logger backing the underlying `Handler`. (#5588)
- `NewHandler` now accepts a `name` `string` as the first argument. This
parameter is used as a replacement of `WithInstrumentationScope` to
specify the name of the logger backing the returned `Handler`. (#5588)
- Upgrade all dependencies of `go.opentelemetry.io/otel/semconv/v1.24.0`
to `go.opentelemetry.io/otel/semconv/v1.25.0`. (#5605)

### Removed

- The `WithInstrumentationScope` option function in
`go.opentelemetry.io/contrib/bridges/otelslog` is removed. Use the
`name` parameter added to `NewHandler` and `NewLogger` as well as
`WithVersion` and `WithSchema` as replacements. (#5588)

### Deprecated

- The `InterceptorFilter` type in
`go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc`
is deprecated. (#5196)
khushijain21 pushed a commit to khushijain21/opentelemetry-go-contrib that referenced this pull request May 22, 2024
### Added

- Add the new `go.opentelemetry.io/contrib/instrgen` package to provide
auto-generated source code instrumentation. (open-telemetry#3068, open-telemetry#3108)
- Add an experimental `OTEL_METRICS_PRODUCERS` environment variable to
`go.opentelemetry.io/contrib/autoexport` to be set metrics producers.
(open-telemetry#5281)
- `prometheus` and `none` are supported values. You can specify multiple
producers separated by a comma.
- Add `WithFallbackMetricProducer` option that adds a fallback if the
`OTEL_METRICS_PRODUCERS` is not set or empty.
- The `go.opentelemetry.io/contrib/processors/baggage/baggagetrace`
module. This module provides a Baggage Span Processor. (open-telemetry#5404)
- Add gRPC trace `Filter` for stats handler to
`go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc`.
(open-telemetry#5196)
- Add a repository Code Ownership Policy. (open-telemetry#5555)
- The `go.opentelemetry.io/contrib/bridges/otellogrus` module. This
module provides an OpenTelemetry logging bridge for
`github.com/sirupsen/logrus`. (open-telemetry#5355)
- The `WithVersion` option function in
`go.opentelemetry.io/contrib/bridges/otelslog`. This option function is
used as a replacement of `WithInstrumentationScope` to specify the
logged package version. (open-telemetry#5588)
- The `WithSchemaURL` option function in
`go.opentelemetry.io/contrib/bridges/otelslog`. This option function is
used as a replacement of `WithInstrumentationScope` to specify the
semantic convention schema URL for the logged records. (open-telemetry#5588)
- Add support for Cloud Run jobs in
`go.opentelemetry.io/contrib/detectors/gcp`. (open-telemetry#5559)

### Changed

- The gRPC trace `Filter` for interceptor is renamed to
`InterceptorFilter`. (open-telemetry#5196)
- The gRPC trace filter functions `Any`, `All`, `None`, `Not`,
`MethodName`, `MethodPrefix`, `FullMethodName`, `ServiceName`,
`ServicePrefix` and `HealthCheck` for interceptor are moved to
`go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/filters/interceptor`.
With this change, the filters in
`go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc`
are now working for stats handler. (open-telemetry#5196)

- `NewLogger` now accepts a `name` `string` as the first argument. This
parameter is used as a replacement of `WithInstrumentationScope` to
specify the name of the logger backing the underlying `Handler`. (open-telemetry#5588)
- `NewHandler` now accepts a `name` `string` as the first argument. This
parameter is used as a replacement of `WithInstrumentationScope` to
specify the name of the logger backing the returned `Handler`. (open-telemetry#5588)
- Upgrade all dependencies of `go.opentelemetry.io/otel/semconv/v1.24.0`
to `go.opentelemetry.io/otel/semconv/v1.25.0`. (open-telemetry#5605)

### Removed

- The `WithInstrumentationScope` option function in
`go.opentelemetry.io/contrib/bridges/otelslog` is removed. Use the
`name` parameter added to `NewHandler` and `NewLogger` as well as
`WithVersion` and `WithSchema` as replacements. (open-telemetry#5588)

### Deprecated

- The `InterceptorFilter` type in
`go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc`
is deprecated. (open-telemetry#5196)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants